/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Demo1 {
    public static class MyThread extends Thread{
        @Override
        public void run() {
            while(true){
                System.out.println("Thread线程打印");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public static void main(String[] args) throws InterruptedException {
        Thread myThread =new MyThread();
        myThread.start();
        while(true){
            System.out.println("main线程打印");
            Thread.sleep(1000);
        }
    }
}
